<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<s:url value="/js/jquery.validate.min.js"/>"></script>
<script type="text/javascript" src="<s:url value="/js/importaciones.js"/>"></script>

<s:form cssClass="tableFilter" >
    <tr>
        <th colspan="4" class="tableTitle">
            <h5>Balance Detail</h5>
        </th>
    </tr>

    <s:hidden name="drogaImportacion.id" value="%{drogaImportacion.id}"/>
    <s:hidden name="drogaImportacion.importacion.id" value="%{drogaImportacion.importacion.id}"/>

    <s:hidden id="country" name="drogaImportacion.importacion.compromisopais.id" value="%{drogaImportacion.importacion.compromisopais.id}" />
    <s:textfield label="Country" disabled="true" value="%{drogaImportacion.importacion.compromisopais.country}"/>

    <s:hidden name="drogaImportacion.importacion.importPermit" value="%{drogaImportacion.importacion.importPermit}" />
    <s:textfield label="Import permit" value="%{importacion.importPermit}" disabled="true"/>

    <s:hidden name="drogaImportacion.droga.id" value="%{drogaImportacion.droga.id}" />
    <s:textfield label="Drug" value="%{drogaImportacion.droga.drugName}" disabled="true"/>

    <s:hidden name="drogaImportacion.initialQty" value="%{drogaImportacion.initialQty}" />
    <s:textfield label="Initial Quantity" value="%{drogaImportacion.initialQty}" disabled="true"/>

    <s:hidden name="drogaImportacion.currentBalance" id="balance" value="%{drogaImportacion.currentBalance}" />
    <s:textfield label="Current Balance" value="%{drogaImportacion.currentBalance}" disabled="true"/>

    <s:hidden name="drogaImportacion.unit" value="%{drogaImportacion.unit}" />
    <s:textfield label="Unit" value="%{drogaImportacion.unit}" disabled="true"/>

    </s:form>

        <table class="table_content" style="width: 60%; margin-left: 20%; margin-top: 50px; margin-bottom: 30px">
            <thead>
            <tr>
                <th>Date</th>
                <th>Protocol</th>
                <th>Discounted</th>
            </tr>
            </thead>
            <tbody>
            <s:iterator value="drogaImportacion.protocoloImportaciones" var="pi">
            <tr>
                <th><s:date name="fecha" format="dd-MMM-yy" /></th>
                <th><s:property value="protocolo.id"/></th>
                <th><s:property value="takeOff"/></th>
            </tr>
            </s:iterator>
            <tbody>
        </table>

<s:form cssClass="tableFilter">
    <tr>
        <td colspan="2" class="centeredButtons">
            <s:submit value="Back" id="cancel" action="cancelDiscount" theme="simple" />
        </td>
    </tr>

</s:form>

<script type="text/javascript">
    actualizarProtocolos('<s:property value="%{protUrl}"/>');
</script>

<script type="text/javascript">
    $('#create').css({"color":"#EE5102","fontWeight":"bold"});
</script>